var carModule = require("../../../class/user/carmodul.c");
module.exports = {
    prefix: "/user/carmodul/",
    get: {
        'list':{
            des: {
                name:'getCarmodlList',
                content:'获取房车型号列表',
                params:[]
            },
            method: function* () {
                var self = this;
                try {
                    var data = yield new carModule().getlist();
                    self.body = data;
                } catch (e) {
                    self.body = printError(e);
                };
            }
        },
        'price':{
            des: {
                name:'getPriceList',
                content:'获取房车价位列表',
                params:[]
            },
            method:function* (){
                var self = this;
                try {
                    self.body = yield new carModule().getpricelist();
                } catch (e) {
                    self.body = printError(e);
                };
            }
        },
        "detail/:_id": {
            des: {
                name: "getcarModuleListAll",
                content: "获取房车型号详情",
                params: [{
                    key:'_id',
                    type:'string'
                }]
            },
            method: function* () {
                var self = this;
                print("获取房车型号详情");
                try {
                    var car_module_detail = yield new carModule().getdetail(self.params._id);
                    self.body = car_module_detail;
                } catch (e) {
                    self.body = printError(e);
                };
            }
        }
    }
}